# pull base image
# --------------
FROM kylin-server-10-sp2-x86:b09

# Maintainer
# --------------
MAINTAINER suming  <suming@bessystem.com>

# Environment variables required for this build
# ---------------------------------------------
ENV JAVA_HOME=/usr/local/docker/java/jdk/jdk1.8.0_333
ENV CLASSPATH=$JAVA_HOME/bin
ENV PATH=.:$JAVA_HOME/bin:$PATH
ENV BES_MQ_HOME /opt/besmq

# Basic support
#-----------------------------
ADD jdk-linux-x64.tar.gz /usr/local/docker/java/jdk/
COPY tar-1.30-11.ky10.x86_64.rpm /tmp/tar-1.30-11.ky10.x86_64.rpm
COPY net-tools-2.0-0.54.ky10.x86_64.rpm /tmp/net-tools-2.0-0.54.ky10.x86_64.rpm
RUN mkdir -p "$BES_MQ_HOME"
COPY BESMQ-2.1.0.1584.tar.gz /tmp/BESMQ-2.1.0.1584.tar.gz
RUN rpm -iv /tmp/tar-1.30-11.ky10.x86_64.rpm && \
    rpm -iv /tmp/net-tools-2.0-0.54.ky10.x86_64.rpm && \
    tar -zxf /tmp/BESMQ-2.1.0.1584.tar.gz -C $BES_MQ_HOME && \
    chmod -R 755 $BES_MQ_HOME && ls -l $BES_MQ_HOME

#Setup besmq
#----------------------------------------------
EXPOSE 3100 3200 3300 8490
WORKDIR $BES_MQ_HOME
ENTRYPOINT cd bin; ./startconsole; tail -f /dev/null

